import BuffUtil from '@/BuffUtil';
import UnitSpellEvent from '@/event/UnitSpellEvent';
import ItemUtil from '@/ItemUtil';
export default class Item_圣剑 {
    static id = 'Aste';
    static 名称: string = '圣剑';
    static 描述: string = '永久增加300点攻击力和法术强度';
    static 图标: string = 'assets\\item\\INV_Sword_25.blp';
    static buffId: string = 'buff_item_shengjian';
    static buffType: AppBuffType = {
        id: 'buff_item_shengjian',
        name: Item_圣剑.名称,
        ubertip: Item_圣剑.描述,
        art: Item_圣剑.图标,
        attribute: {
            attack: 300,
            法术强度: 300,
        },
    };
    static 添加技能(目标: unit) {
        UnitAddAbility(目标, Item_圣剑.id);
    }
    static 释放(x: number, y: number, 来源?: unit, 目标?: unit, d?: any) {
        if (BuffUtil.hasUnitBuff(目标, Item_圣剑.buffId)) {
            DisplayTextToPlayer(GetOwningPlayer(来源), 0, 0, '目标已经获得了圣剑的能力');
            return;
        }
        let it = ItemUtil.getItemOfTypeFromUnit(来源, 'shcw');
        BuffUtil.addBuff(目标, Item_圣剑.buffId);
        RemoveItem(it);
    }
    constructor() {
        BuffUtil.registerBuffType(Item_圣剑.buffType);
        se.onUnitSpellEffect(Item_圣剑.spellEffect, Item_圣剑.id);
    }
    static spellEffect(this: void, d: UnitSpellEvent) {
        Item_圣剑.释放(d.spellTargetX, d.spellTargetY, d.trigUnit, d.spellTargetUnit, d);
    }
}
